This TechNote covers how to create a link
in a child page, opened using the Open Browser
Window behavior, that targets the parent window.
This is useful in applications such as
notification popups (e.g., "you have a private
message" notifications). There can be a link on
the notification window to open the message page
in the main window.
It is assumed that you have created an Open
Browser Window behavior in the parent
page.
Using the Call JavaScript
behavior If you are not familiar with hand coding,
you may use the Call JavaScript behavior, as
described below:
1 |
Open the child page (the page that is
opened using the Open Browser Window
behavior). |
2 |
Create a null link for the text or image
on the child page that will link back to the
parent window. For instructions on creating a
null link, see Null
links cause browser to jump to top of page
(TechNote 14105). |
3 |
Reselect the linked text or
image. |
4 |
Choose Window > Behaviors to open the
Behaviors panel. |
5 |
Click the Plus (+)
button. |
6 |
From the Behavior panel's Actions pop-up
menu, select the Call JavaScript
behavior. |
7 |
In the JavaScript dialog, type the
following code: window.opener.location='somepage.htm' where somepage.htm
is the URL of the page that you want to
link. Be sure to use single
quotes. |
8 |
Click OK to close the Call JavaScript
dialog box. |
Hand
coding: If you are comfortable with hand coding,
then perform the following steps:
1
|
Open the child page (the page that is
opened using the Open Browser Window
behavior). |
2 |
Create a null link for the text or image
on the child page that will link back to the
parent window. For instructions on creating a
null link, see Null
links cause browser to jump to top of page
(TechNote 14105). |
3 |
Create an onClick event for the link as
follows, where somepage.htm
is the URL of the page that you want to
link.
<a
href="javascript:;"
onClick="window.opener.location='somepage.htm'"> |
Additional information
For more information about null links and
text links, see Null
links cause browser to jump to top of page
(TechNote 14105) and Applying
JavaScript behaviors to text links (TechNote
15495).
|